<%-------------------------------------------------------------------
 * 页面名称：postRemitInpour_1.jsp
 * 功能描述：邮局汇款充值/充值信息修改
 * Action: 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%
	String path = request.getContextPath();
%>
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/newstyle.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/common.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
<script type="text/javascript" src="<%=path%>/js/choiceCity.js"></script>
<script type='text/javascript' src='<%=path%>/dwr/interface/AccountLogic.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/interface/accountTemplate.js'></script>
<script type="text/javascript" src='<%=path%>/js/vnv/commonForMutual.js' charset="UTF-8"></script>
<script type="text/javascript" src='<%=path%>/js/vnv/commonForManage.js' charset="UTF-8"></script>
<script type='text/javascript' src='<%=path%>/js/vnv/commonForCnAmount.js'></script>
<script type='text/javascript' src='<%=path%>/js/vnv/tomoney.js'></script>
<script language="JavaScript" type="text/JavaScript">
function update(){
	if($("remitProvinceId").value!=""){
    	AccountLogic.getCityList(createList, $("remitProvinceId").value);
    }
}
function createList(data){
	DWRUtil.removeAllOptions("remitCityId");
	DWRUtil.addOptions("remitCityId", data,"cityId","cityName");
}
function submitProcess() {
	var formObj = document.forms["0"];
	if(checkNecessaryInput(formObj)){
		if(formObj.remitProvinceId.value==""){
	    	alert('请选择省份!');
	    	return;
	    }
	    if(formObj.remitCityId.value==""){
	    	alert('请选择城市!');
	    	return;
	    }
	      if(document.getElementById('remark').value.length>85){
	    	alert('您输入的备注内容过长！');
	    	return;
	    }
		formObj.submit();
	}
}
function kd(){
	var ss=getObj("amount").value;
	ss = ss.replace(/ /g,"");
	if (ss=="") {
		getObj("upperAmount").value="";
		return;
	}
	
	var sDispMsg = getChineseCurrencyString(ss);
	if(sDispMsg==-1) sDispMsg="错误的金额!";
	if(sDispMsg==-2) sDispMsg="太长的金额!";
	getObj("upperAmount").value=sDispMsg;
}
function updatePrompt(data) {
}
</script>

<div id="mainFrame">
  <div class="rightSider2">
    <div class="sub_title"><span class="bluefont18bdrop"><logic:notEmpty name="PostRemitInpourForm" property="transId">修改</logic:notEmpty>邮局汇款充值</span></div>
    <div class="edit_pass">
      <table width="100%" border="0" align="center" cellpadding="7" cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
        <tr>
          <td bgcolor="#fffdf5"><table width="100%" border="0" cellpadding="3" cellspacing="0">
              <tr >
                <td width="3%" height="25" valign="top" style="border-bottom:1px solid #ccc;"><img src="<%=path%>/images/ren.gif" width="22" height="21" border="0" align="absmiddle" /></td>
                <td width="97%" align="left" class="red12b" style="border-bottom:1px solid #ccc;">特别提醒</td>
              </tr>
              <tr>
                <td valign="top">&nbsp;</td>
                <td align="left" class="font_gray"><img src="<%=path%>/images/arrow2.gif" width="16" height="16" align="absmiddle" /> 请您<span class="redColor12px">先输入</span>汇款明细，<span class="redColor12px">再到</span>邮局填写汇款单进行汇款，谢谢！</td>
              </tr>
              <tr>
                <td valign="top">&nbsp;</td>
                <td align="left" class="font_gray"><img src="<%=path%>/images/arrow2.gif" width="16" height="16" align="absmiddle" /> 支付账户<span class="text9green">不允许</span>进行虚假交易、银行卡转账套现或洗钱等被禁止的交易行为，否则充值款项将不能提现</td>
              </tr>
          </table></td>
        </tr>
      </table>
      <html:form method="post" action="postRemitInpour" >
	  <html:hidden property="step"/>
	  <html:hidden property="actionType"/>
	  <html:hidden property="transId"/>
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" >
          <tr>
            <td width="23%" align="right">充值子账户：</td>
            <td width="77%">
                <div class="select"><div>
		        <html:select property="subAccountId">
				  <html:options collection="subAccounts" property="accountId" labelProperty="accountName" /> 
				</html:select></div></div>
			</td>
          </tr>
          <tr>
            <td align="right"><span class="orang12b">*</span>充值金额：</td>
            <td><html:text property="amount" alt="充值金额" size="50" styleClass="inputStyle" 
		onblur="if(checkDecimalInput(this,0)){accountTemplate.ifAccountIsEffect(this.value, updatePrompt)} ;tomoney('forms[0]','amount','hideTransAmt');kd();" onkeyup="kd();" onchange="kd();"/>元
              &nbsp;&nbsp;<img src="<%=path%>/images/money.gif" width="17" height="17" border="0" style="cursor:hand" title="请使用计算器，计算充值金额" onclick="amountSelect();" />
              <input type="hidden" name="hideTransAmt" value="" />            </td>
          </tr>
          <tr>
            <td align="right">充值金额大写：</td>
            <td><input name="upperAmount" type="text" class="inputStyleNoborder" size="50" style="background:#F6F6F6;" readonly /></td>
          </tr>
        <tr>
          <td align="right"><span class="orang12b">*</span>汇款省份：</td>
          <td><div class="select"><div>
			  <html:select property="remitProvinceId" onchange="update()" alt="汇款省份">
				<option value="" selected>----请选择您的汇款省份----</option>
				<html:options collection="provinceList" property="cityId" labelProperty="cityName" />
			  </html:select></div></div>
		  </td>
        </tr>
        <tr>
	     <td align="right"><span class="orang12b">*</span>汇款城市：</td>
	     <td>
		 <div class="select"><div>
		  <select name="remitCityId" alt="汇款城市">
			<option value="" selected>----请选择您的汇款城市----</option>
		  </select></div></div>
		 </td>
	  </tr>
	  <tr>
	    <td align="right">备注：</td>
	    <td><html:textarea property="remark" rows="5" cols="35" style="border:1px solid #ccc;" /></td>
	  </tr>
	  <logic:present name="org.apache.struts.action.ERROR">
	  <tr><td align="center">&nbsp;</td>
	  <td height="25" class="twoSiderLine" >&nbsp;<font color="#FF0000"><html:errors/></font></td></tr>
	  </logic:present>
        <tr>
          <td align="center">&nbsp;</td>
          <td bgcolor="#FFFFFF"><input name="button2" type="button" class="button_style" onclick="submitProcess();" value="下一步"/></td>
        </tr>
      </table>
      </html:form>
    </div>
  </div>
</div>

<script type="text/javascript" src="<%=path%>/js/layer.js"></script>
<script language="JavaScript" type="text/JavaScript">
function closeLayer(returnValue, type){
	hideLayer();
	if(type=="amount"){
		document.forms[0].amount.value=returnValue;
		document.forms[0].amount.focus();
		kd();
	}
}

function amountSelect(){
 	agiledata.getUserInternal(amountPopup);
}
function amountPopup(data) {
  	if(data) {
	 	openLayer("<%=path%>/page/common/simpleCalculator.jsp",400,200,false);
	} else {
		location.href="<%=path%>/page/util/session_invalid.jsp";
	}
}

function setRemitCityId(v) {
	if (v!=null && v!='')
		document.forms[0].remitCityId.value = v;
}

//显示预先设置的金额的大写
kd();

//显示预先设置的开户行城市
if ('<bean:write name="PostRemitInpourForm" property="remitCityId"/>'!='') {
	update();
	window.setTimeout('setRemitCityId(<bean:write name="PostRemitInpourForm" property="remitCityId"/>)', 500);
}

</script>